import {call, put, takeEvery, takeLatest} from 'redux-saga/effects'
import {fetch_get_menu} from '../fetchApi/index'


function* saga_fetch_get_menu(action) {
    try {
        const menus = yield call(fetch_get_menu, {}/*params*/);
        debugger
        yield put({type: "fetch_get_menu_success", menus: menus});
    } catch (e) {
        debugger
        yield put({type: "fetch_get_menu_fail", message: e.message});
    }
}

/*listion */
export default function* mySaga() {
    yield takeEvery("fetch_get_menu_requested", saga_fetch_get_menu);
}